package graph.element.axe;
import graph.GraphPanel;
import graph.element.element;
import graph.label.Label;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Line2D;
import java.util.ArrayList;
import data.Dimensions;
public abstract class Axe extends element {
	public int x2;
	public int y2;
	public ArrayList<Label> Labels;
	public static int INC = 50;
	protected boolean decal;
	public Axe(GraphPanel graphingData, boolean decal, int x, int y, int x2, int y2, Dimensions Dimensions) {
		super(graphingData, x, y);
		this.decal = decal;
		this.Labels = genLabels(Dimensions);
		this.x2 = x2;
		this.y2 = y2;
		
	}
	public void draw() {
		Graphics g = graphingData.getG();
		Graphics2D g2 = (Graphics2D)g;
		int x = getX();
		int y = getY();
		g2.draw(new Line2D.Double(x, y, x2, y2));
		drawTicks();
		drawLabels();
	}
	
	protected void drawLabels() {
		for (Label label: Labels) {
			label.draw();
		}
	}
	
	protected abstract ArrayList<Label> genLabels(Dimensions Dimensions);
	protected abstract void drawTicks();
	

}
